﻿<!--Copyright 2010 http://tv4home.codeplex.com
This file is part of TV4Home.Client.TVViewer.
TV4Home.Client.TVViewer is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version.
TV4Home.Client.TVViewer is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with TV4Home.Client.TVViewer. If not, see http://www.gnu.org/licenses/-->
    <Window x:Class="TV4Home.Client.Desktop.TVViewer.MainWindow"  
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:i="http://schemas.microsoft.com/expression/2010/interactivity" 
    xmlns:ei="http://schemas.microsoft.com/expression/2010/interactions" 
	xmlns:ee="http://schemas.microsoft.com/expression/2010/effects"
        xmlns:my="clr-namespace:TV4Home.Client.Desktop.TVViewer"
         xmlns:media="clr-namespace:TV4Home.Client.Desktop.TVViewer.Controls"
	x:Name="TVViewerMain" 
    mc:Ignorable="d" SnapsToDevicePixels="True"
	WindowStartupLocation="CenterScreen"
    Width="1120" Height="662"
    d:DesignWidth="900" d:DesignHeight="480"        
    TextOptions.TextFormattingMode="Display"
    TextOptions.TextRenderingMode="ClearType"
	PreviewMouseMove="ResetCursor"
    Title="TV Viewer"
	BorderBrush="#FF3F3F3F" WindowStyle="None" AllowsTransparency="True" Background="{x:Null}" Loaded="TVViewerMain_Loaded" ShowInTaskbar="False">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="/Assets/Styles.xaml"/>
                <ResourceDictionary Source="/Assets/CoreStyles.xaml"/>
                <ResourceDictionary Source="/Assets/CommonResources.xaml"/>
            </ResourceDictionary.MergedDictionaries>
            <DataTemplate x:Key="ComboboxItemTemplate">
                <StackPanel Orientation="Horizontal">
                    <TextBlock Text="{Binding Path=GroupName}" />
                </StackPanel>
            </DataTemplate>           
        </ResourceDictionary>
        
    </Window.Resources>
    <Grid x:Name="LayoutRoot">
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="WindowStateGroup">
                <VisualStateGroup.Transitions>
                    <VisualTransition GeneratedDuration="0"/>
                </VisualStateGroup.Transitions>
                <VisualState x:Name="NormalState"/>
                <VisualState x:Name="MaximizedState">
                    <Storyboard>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="EdgeBorder">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}"/>
                        </ObjectAnimationUsingKeyFrames>
                        <ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.Margin)" Storyboard.TargetName="ContentGrid">
                            <EasingThicknessKeyFrame KeyTime="0" Value="0"/>
                        </ThicknessAnimationUsingKeyFrames>
                        <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="FrameGrid">
                            <DiscreteObjectKeyFrame KeyTime="0" Value="{x:Static Visibility.Collapsed}"/>
                        </ObjectAnimationUsingKeyFrames>
                    </Storyboard>
                </VisualState>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>


        <Border x:Name="EdgeBorder" Margin="0" Background="White" IsHitTestVisible="False" IsEnabled="False" d:IsLocked ="true">
            <Border.Effect>
                <DropShadowEffect Opacity="0.695" BlurRadius="20" ShadowDepth="0"/>
            </Border.Effect>
        </Border>
        <!--Style="{StaticResource LayoutRootGridStyle}" -->
        <Grid x:Name="ContentGrid" Margin="0" Background="White" >
            <Rectangle Height="55" VerticalAlignment="Top" Fill="White" PreviewMouseDown="Header_Drag"/>
            <TextBlock x:Name="textBlock" FontSize="16" Margin="90,13,450,0" VerticalAlignment="Top" 
				Foreground="#FFD0D0D0" TextTrimming="CharacterEllipsis" IsHitTestVisible="False" Opacity="0">

            </TextBlock>
            <Button x:Name="btnBack" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="59,14,0,0" 
				Style="{DynamicResource ChromeButtonStyle}" SnapsToDevicePixels="True" Click="btnBack_Click" >
                <Path Stretch="Fill" Stroke="#FF474747" Width="20" RenderTransformOrigin="0.5,0.5" Fill="#00FF0000"
					Height="20"	d:LayoutOverrides="HorizontalAlignment" StrokeThickness="1"
					Data="M137.5,70 C137.5,107.27922 107.27922,137.5 70,137.5 C32.720779,137.5 2.5,107.27922 2.5,70 C2.5,32.720779 32.720779,2.5 70,2.5 C107.27922,2.5 137.5,32.720779 137.5,70 z M33.166992,72.333008 L111.16699,72.333008 M70.833,32.333019 L109.846,71.346016 M112.49997,70.5 L74.969971,108.03" d:IsLocked="True">

                    <Path.RenderTransform>
                        <TransformGroup>
                            <ScaleTransform ScaleX="-1" />
                            <SkewTransform AngleX="0"
								AngleY="0" />
                            <RotateTransform Angle="0" />
                            <TranslateTransform />
                        </TransformGroup>
                    </Path.RenderTransform>
                </Path>
            </Button>
            <Button HorizontalAlignment="Right" VerticalAlignment="Top"
                    FontSize="10" Width="81" Height="20" Margin="0,10,120,0"
                    x:Name="btnFullscreen" Click="btnFullscreen_Click" Content="Fullscreen"  Style="{StaticResource ChromeButtonStyle}" Foreground="Black" >
                
            </Button>
            <Button HorizontalAlignment="Right" Margin="0,10,73,0" VerticalAlignment="Top"
                   Style="{StaticResource ChromeButtonStyle}" Click="btnSettings_Click"
                    Height="20" Content="Settings" Name="btnSettings" FontSize="10" Width="81" Foreground="Black">
            </Button>
            
            <Button HorizontalAlignment="Right" Margin="500,10,45,0" VerticalAlignment="Top" 
				Style="{StaticResource ChromeButtonStyle}" Click="MinimizeButton_Click">
                <TextBlock TextWrapping="Wrap" Text="0" FontFamily="Webdings" Foreground="#FF919191" FontSize="13.333"/>
            </Button>
            <Button x:Name="RestoreButton" HorizontalAlignment="Right" Margin="500,10,26,0" VerticalAlignment="Top"
                Style="{StaticResource ChromeButtonStyle}" Click="RestoreButton_Click">
                <TextBlock TextWrapping="Wrap" Text="1" FontFamily="Webdings" Foreground="#FF919191" FontSize="13.333"/>
            </Button>
            
            <Button HorizontalAlignment="Right" Margin="500,10,8,0" VerticalAlignment="Top" 
				Style="{StaticResource ChromeButtonStyle}" Click="CloseButton_Click">
                <TextBlock TextWrapping="Wrap" Text="r" FontFamily="Webdings" Foreground="#FF919191" FontSize="13.333" />
            </Button>
            <Grid x:Name="NavigationGrid" Style="{StaticResource NavigationGridStyle}">

                <Border x:Name="LinksBorder" Style="{StaticResource LinksBorderStyle}">
                    <ItemsControl ItemsSource="{Binding SiteMapNodes}" IsTabStop="False" 
        				ItemsPanel="{StaticResource HeaderLinksItemsTemplate}"
        				ItemTemplate="{StaticResource HeaderLinkItemTemplate}">
                    </ItemsControl>
                </Border>

                <Border x:Name="BrandingBorder" Style="{StaticResource BrandingBorderStyle}">
                    <StackPanel x:Name="BrandingStackPanel" Style="{StaticResource BrandingStackPanelStyle}">
                        <ContentControl Style="{StaticResource LogoIcon}" Margin="600,0,260,0" IsHitTestVisible="False"/>
                        <TextBlock x:Name="ApplicationNameTextBlock" Style="{StaticResource ApplicationNameStyle}" 
        					Text="TV 4 Home TV Viewer" TextOptions.TextFormattingMode="Display" TextOptions.TextRenderingMode="ClearType" 
							TextOptions.TextHintingMode="Auto" FontSize="26.667" Margin="0,-14,0,0" FontFamily="Segoe UI Light" 
							IsHitTestVisible="False" FontWeight="Bold"/>

                    </StackPanel>
                </Border>

            </Grid>
            <Border x:Name="ContentBorder" Style="{StaticResource ContentBorderStyle}" Background="{x:Null}" Margin="60,76,0,0" BorderThickness="0">
                <Grid>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="38" />
                        <RowDefinition />
                    </Grid.RowDefinitions>
                    <Button Style="{StaticResource ChromeButtonStyle}"  HorizontalAlignment="Left" Content="TV" x:Name="btnTVViewerPage" Click="btnTVViewerPage_Click" Width="100" />
                    <Button Style="{StaticResource ChromeButtonStyle}"  HorizontalAlignment="Left" Margin="120,0,0,0" Content="Schedules"  x:Name="btnSchedulesPage" Click="btnSchedulesPage_Click" Grid.RowSpan="1" Width="100" />
                    <Grid Margin="248,14,14,14" Grid.Row="1" x:Name="ContentFrameGrid">
                        <media:MediaPlayer x:Name="MediaElement" />

                    </Grid>
                       <Frame x:Name="contentFrame" NavigationUIVisibility="Hidden" Grid.Row="1" Margin="0" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
                </Grid>
            </Border>

            <Border Background="#BFFFFFFF" Visibility="Collapsed" d:IsHidden="True" d:IsLocked="True">


            </Border>
            <Popup x:Name="popup" IsOpen="False" Margin="30" PopupAnimation="Fade" AllowsTransparency="True" Placement="MousePoint" HorizontalAlignment="Center" VerticalAlignment="Center" d:IsHidden="True" d:IsLocked="True">

            </Popup>

        </Grid>

        <Grid Margin="0" x:Name="FrameGrid" d:IsLocked="True" >
            <Rectangle Stroke="{x:Null}" VerticalAlignment="Top" Height="7" x:Name="top" PreviewMouseDown="Resize" MouseMove="DisplayResizeCursor" Margin="8,0,8,0" Fill="#00000000"/>
            <Rectangle Stroke="{x:Null}" x:Name="bottom" Height="7" VerticalAlignment="Bottom" PreviewMouseDown="Resize" MouseMove="DisplayResizeCursor" Margin="8,0,8,0" Fill="#00000000"/>
            <Rectangle Stroke="{x:Null}" HorizontalAlignment="Left" Margin="0,7,0,7" Width="8" x:Name="left" PreviewMouseDown="Resize" MouseMove="DisplayResizeCursor" Fill="#00000000"/>
            <Rectangle  Stroke="{x:Null}" Margin="0,7,0,7" Width="8" HorizontalAlignment="Right" x:Name="right" PreviewMouseDown="Resize" MouseMove="DisplayResizeCursor" Fill="#00000000"/>
            <Rectangle Stroke="{x:Null}" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="8" Height="7" x:Name="bottomLeft" PreviewMouseDown="Resize" MouseMove="DisplayResizeCursor" Fill="#00000000"/>
            <Rectangle Stroke="{x:Null}" VerticalAlignment="Bottom" Height="7" Width="8" HorizontalAlignment="Right" x:Name="bottomRight" PreviewMouseDown="Resize" MouseMove="DisplayResizeCursor" Fill="#00000000"/>
            <Rectangle Stroke="{x:Null}" HorizontalAlignment="Right" Width="8" Height="7" VerticalAlignment="Top" x:Name="topRight" PreviewMouseDown="Resize" MouseMove="DisplayResizeCursor" Fill="#00000000"/>
            <Rectangle Stroke="{x:Null}" HorizontalAlignment="Left" Width="8" VerticalAlignment="Top" Height="7" x:Name="topLeft" PreviewMouseLeftButtonDown="Resize"  MouseMove="DisplayResizeCursor" Fill="#00000000"/>
            <Path Data="M9.5390625,2.4619789 L9.5390625,11.133854 L0.8671875,11.133854 z" HorizontalAlignment="Right" Height="8.672" Margin="0,0,1.014,0.779" RenderTransformOrigin="0.5,0.5" Stretch="Fill" VerticalAlignment="Bottom" Width="8.672" d:LayoutOverrides="HorizontalAlignment, VerticalAlignment" StrokeDashArray="0.5 1" StrokeDashOffset="2" Fill="#FF119EDA" IsHitTestVisible="False" IsEnabled="False" StrokeThickness="0">
                <Path.RenderTransform>
                    <TransformGroup>
                        <ScaleTransform/>
                        <SkewTransform/>
                        <RotateTransform/>
                        <TranslateTransform/>
                    </TransformGroup>
                </Path.RenderTransform>
            </Path>
        </Grid>
        <Border x:Name="brdSettings" Margin="300,100,300,350" MaxHeight="300" MaxWidth="500" Panel.ZIndex="1" >
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="35" />
                    <ColumnDefinition Width="420*" />
                    <ColumnDefinition Width="35" />
                </Grid.ColumnDefinitions>
                <Grid.RowDefinitions>
                    <RowDefinition Height="27" />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Rectangle x:Name="details_overlay" Visibility="Hidden"  Fill="WhiteSmoke" Stroke="#FF2D2D2D" Grid.RowSpan="2" Grid.ColumnSpan="3">
                    <Rectangle.Effect>
                        <DropShadowEffect Opacity="0.695" BlurRadius="14" ShadowDepth="0" Color="#FF434343"/>
                    </Rectangle.Effect>
                </Rectangle>
               <Rectangle Name="topRectangle" Grid.Column="1" Grid.Row="0" Fill="{StaticResource BaseBlueBrush}" Visibility="Hidden" />
                <Button Name="btnCloseSettings" HorizontalAlignment="Right" Margin="3" VerticalAlignment="Top" Visibility="Hidden"
				Style="{StaticResource SemiTransparentButton2}" ButtonBase.Click="btnCloseSettings_Click" Grid.Column="1" Grid.Row="0">
                    <TextBlock TextWrapping="Wrap" Text="r" FontFamily="Webdings" FontSize="13.333" />
                </Button>
                <Grid Grid.Column="1" Grid.Row="1">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="99*" />
                        <RowDefinition Height="68*" />
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="100" />
                        <ColumnDefinition />
                    </Grid.ColumnDefinitions>
                    <Label Content="TV Server Name" Height="25" HorizontalAlignment="Left" Margin="0,10,0,0" Name="lblServerName" VerticalAlignment="Top" Visibility="Hidden" />
                    <Label Content="Gruppen" Height="25" HorizontalAlignment="Left" Margin="0,45,0,0" Name="lblGroups" VerticalAlignment="Top"  Visibility="Hidden" />                  
                    <ComboBox Style="{StaticResource SemiTransparentCombobox}"  Height="25" HorizontalAlignment="Left" Margin="5,45,0,0" Name="cbChooseGroup"  VerticalAlignment="Top" Width="120" ItemTemplate="{StaticResource ComboboxItemTemplate}" Visibility="Hidden" Grid.Column="1" />
                    <TextBox Height="25" HorizontalAlignment="Left" Margin="5,10,0,0" Name="tbServerName" VerticalAlignment="Top" Width="121" Visibility="Hidden" Grid.Column="1"  />
                    <CheckBox Content="Nutzung daheim?" Height="15" HorizontalAlignment="Left" Margin="143,15,0,0" Name="chbIsIntranet" VerticalAlignment="Top" IsChecked="True" Visibility="Hidden" Grid.Column="1" />
                    <Button Style="{StaticResource SemiTransparentButton}"  Content="Daten prüfen" Height="25" HorizontalAlignment="Left" Margin="143,45,0,0" Name="btnCheckServer" VerticalAlignment="Top" Width="92" Visibility="Hidden" ButtonBase.Click="btnCheckServer_Click" Grid.Column="1" Grid.Row="0" />
                    <Button Style="{StaticResource SemiTransparentButton}"  Content="Speichern" Height="23" HorizontalAlignment="Right" Margin="25" Name="btnSave" VerticalAlignment="Bottom" Width="92" Visibility="Hidden" ButtonBase.Click="btnSave_Click" Grid.Column="1" Grid.Row="1" />
                   

                </Grid>
                </Grid>
        </Border>     
        <Rectangle x:Name="complete_overlay" Opacity="0.7" Fill="#FF060202" Stroke="#FF000000" Visibility="Hidden" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="0,0,0,0" MouseLeftButtonDown="complete_overlay_MouseLeftButtonDown"/>
    </Grid>
</Window>
